import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '姓名',
    dataIndex: 'userName',
    width: 120,
  },
  {
    title: '手机号',
    dataIndex: 'mobile',
    width: 120,
  },
  {
    title: '证件类型',
    dataIndex: 'identityType',
    width: 120,
    dictData: [
      { label: '身份证', value: 1 },
      { label: '护照', value: 2 },
      { label: '回乡证(港澳台居民来往内地通行证)', value: 3 },
      { label: '台胞证', value: 4 },
      { label: '其他', value: 5 },
      { label: '军人证', value: 6 },
      { label: '外国居留身份证', value: 7 },
      { label: '港澳台居民居住证', value: 8 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '证件号码',
    dataIndex: 'identityNo',
    width: 180,
  },
  {
    title: '亲友券码',
    dataIndex: 'qrCode',
    width: 180,
  },
  {
    title: '状态',
    dataIndex: 'userGoodsState',
    width: 120,
    dictData: [
      { label: '未使用', value: 1 },
      { label: '已使用', value: 2 },
      { label: '已撤销', value: 3 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '姓名',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'mobile',
    label: '手机号',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'qrCode',
    label: '亲友券码',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'userGoodsState',
    label: '券码状态',
    component: 'Select',
    colProps: { span: 4 },
    componentProps: {
      options: [
        { label: '未使用', value: 1 },
        { label: '已使用', value: 2 },
        { label: '已撤销', value: 3 },
      ],
    },
  },
];
